package ooday03;
public class Test {
    public static void main(String[] args) {

        Dog []dogs=new Dog[3];
        dogs[0]=new Dog("小黑",2,"黑");
        dogs[1]=new Dog("小白",1,"白");
        dogs[2]=new Dog("小灰",3,"灰");
        System.out.println(dogs[0].name);
        dogs[1].age=3;
        dogs[2].swim();


        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }




        Chick[] chicks=new Chick[5];
        chicks[0]=new Chick("坤坤",2,"黑");
        chicks[1]=new Chick("阿坤",25,"灰");
        chicks[2]=new Chick("坤哥",20,"棕");
        chicks[3]=new Chick("坤子",15,"红");
        chicks[4]=new Chick("小黑子",10,"黄");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].egg();
        }



        Fish []fish=new Fish[2];
        fish[0]=new Fish("金鱼",1,"金");
        fish[1]=new Fish("红鱼",2,"红");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].swim();
        }


    }
}
